package com.lupus.util;
import java.util.*;

public final class CacheUtil {
	private static Map<String,Map<String,String>> catchMap = new HashMap<String,Map<String,String>>();
	
	public static String getCacheValue(String uniqueCode,String keyValue){
		String cacheValue = null;
		Map<String,String> valueMap = getCacheMap(uniqueCode);
		if(valueMap!=null){
			cacheValue = valueMap.get(keyValue);
		}
		return cacheValue;
	}
	
	public static Map<String,String> getCacheMap(String uniqueCode){
		return catchMap.get(uniqueCode);
	}
	
	public static void setCacheValue(String uniqueCode,Map<String,String> cacheValueMap){
		if(cacheValueMap==null||uniqueCode==null)return;
		catchMap.put(uniqueCode,cacheValueMap);
	}
	
	public static boolean existCache(String uniqueCode){
		return getCacheMap(uniqueCode)!=null;
	}
}
